﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Project09
{
    class Object
    {      
        private Texture2D texture;
        public Texture2D Texture
        {
            get { return texture; }
            set { texture = value; }
        }
       
        private float  mass;
        public float Mass
        {
            get { return mass; }
            set { mass = value; }
        }

        private float position;
        public float Position
        {
            get { return position; }
            set { position = value; }
        }

        private float iVelocity;
        public float InitialVelocity
        {
            get { return iVelocity; }
            set { iVelocity = value; }
        }

        private float fVelocity;
        public float FinalVelocity
        {
            get { return fVelocity; }
            set { fVelocity = value; }
        }

        private Vector2 origin;
        public Vector2 Origin
        {
            get { return origin; }
            set { origin = value; }        
        }

        public Object(Texture2D texture, float position, float mass, float velocity)
        {
            this.texture = texture;
            this.position = position;
            this.mass = mass;
            this.iVelocity = velocity;

            origin = new Vector2(texture.Width / 2, texture.Height / 2);
        }

        public void Draw(SpriteBatch spriteBatch, Vector2 offset)
        {
            spriteBatch.Draw(Texture, new Vector2(Position, 0) + offset, null, Color.White, 0, origin, 1f, SpriteEffects.None, 0f);
        }
    }
}
